package com.ftwj.demo.generate.entity;

import java.io.Serializable;

import com.ftwj.demo.generate.utils.DataTypeConversionUtil;
import com.ftwj.demo.generate.utils.StringUtil;


/**
*
* <p>Title: ColumnInfo</p>  
* <p>Description: 描述</p>
* <p>Copyright: Copyright (c) 2020 </p>  
* <p>Company: 兰州飞天网景信息产业有限公司</p>    
* @author WangSLi
* @date 2020年2月27日 下午1:52:40
* @version V1.0
 */
public class ColumnInfo implements Serializable {
	
    /** serialVersionUID*/ 
	private static final long serialVersionUID = 1L;
	
	private String columnName; //表：列名
	private String propertyName; //类：属性名
	private Boolean isPrimaryKey; //表：是否主键
	//private Integer type; //表：类型
	private String typeName; //表：类型名
	private String javaType; //类：类型
    private String remarks; //表：注释

    public ColumnInfo(String columnName, String typeName, Boolean isPrimaryKey, String remarks) {
        this.columnName = columnName;
        this.propertyName = StringUtil.columnName2PropertyName(columnName);
        //this.type = type;
        this.typeName = typeName;
        this.javaType=DataTypeConversionUtil.sqlTypeToJava(typeName);
        this.isPrimaryKey = isPrimaryKey;
        this.remarks=remarks;
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }
    /*
    public int getType() {
        return type;
    }

	public void setType(Integer type) {
    	this.type = type;
    }
    */
    
    public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getPropertyName() {
        return propertyName;
    }
    
    public void setPropertyName(String propertyName) {
		this.propertyName = propertyName;
	}

	public String getJavaType() {
		return javaType;
	}
	
	public void setJavaType(String javaType) {
		this.javaType = javaType;
	}

	public Boolean getIsPrimaryKey() {
    	return isPrimaryKey;
    }
    
    public void setIsPrimaryKey(Boolean isPrimaryKey) {
    	this.isPrimaryKey = isPrimaryKey;
    }

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	@Override
	public String toString() {
		return "ColumnInfo [columnName=" + columnName + ", propertyName=" + propertyName + ", isPrimaryKey="
				+ isPrimaryKey + ", typeName=" + typeName + ", javaType=" + javaType + ", remarks=" + remarks + "]";
	}
	
}
